package lab02.Test11;

/**
 * Created by 李晓容 on 2017/10/24.
 */
public class Rectangle implements Printx {
    double length;
    double width;
    Rectangle(double a,double b){length=a;width=b;}



    @Override
    public void printMyWay() {
        System.out.println("矩形长："+length);
        System.out.println("矩形宽:"+width);
        System.out.println("周长："+2*(width+length));
        System.out.println("面积："+width*length);

    }

    public static void main(String[] args) {
        Rectangle S = new Rectangle(4,3);
        System.out.println("矩形");
        S.printMyWay();



    }
}
